package users;

import io.DataAccess;

import java.util.List;

/**
 * A class primarily for storing information after a database reads
 * in user information for the first time.  Rather than having to
 * read from the database constantly to do functions, the software
 * can use this local data object instead.
 * @author Aaron Chen
 * @version skeleton
 */
public class User {

  /** A unique identification number for each user.  Used primarily
   * for database lookup tables. */
  private long my_id;

  /** The email address of the registered user.  This must be provided
   * during registration and cannot be blank or otherwise invalid. */
  private String my_email;

  /** The first name of the user. */
  private String my_first_name;

  /** The last name of the user. */
  private String my_last_name;

  /** The list of roles that the user has per conference, if any. */
  private List my_roles;


  public User(List<String> userData) {
    my_id = Long.parseLong(userData.get(DataAccess.USER_ID));
    my_first_name = userData.get(DataAccess.USER_FIRSTNAME);
    my_last_name = userData.get(DataAccess.USER_LASTNAME);
    my_email = userData.get(DataAccess.USER_EMAIL);
  }
  
  public User(String first, String last, String email) {
    my_first_name = first;
    my_last_name = last;
    my_email = email;
  }
  
  public long getID() {
    return my_id;
  }
  
  public void setID(final long the_id) {
    my_id = the_id;
  }

  public String getEmail() {
    return my_email;
  }

  public String getFirstName() {
    return my_first_name;
  }

  public String getLastName() {
    return my_last_name;
  }

  public List getRoles() {
    return my_roles;
  }

}
